{% extends "base.html" %}

{% block content %}
<div class="container">
    <h1>登录</h1>
    <form action="" method="post" novalidate>
        {{ form.hidden_tag() }}
        <div class="form-group">
            {{ form.username.label }}
            {{ form.username(class="form-control") }}
            {% for error in form.username.errors %}
            <span class="text-danger">{{ error }}</span>
            {% endfor %}
        </div>
        <div class="form-group">
            {{ form.password.label }}
            {{ form.password(class="form-control") }}
            {% for error in form.password.errors %}
            <span class="text-danger">{{ error }}</span>
            {% endfor %}
        </div>
        <div class="form-check">
            {{ form.remember_me(class="form-check-input") }}
            {{ form.remember_me.label(class="form-check-label") }}
        </div>
        {{ form.submit(class="btn btn-primary mt-3") }}
    </form>
    <p class="mt-3">新用户？ <a href="{{ url_for('auth.register') }}">点击注册</a></p>
</div>
{% endblock %} 